#include <map>
#include <string>

struct ChatMessage {
	ChatMessage() { }
    ChatMessage(const std::string& person_, const std::string& message_)
    : person(person_),
      message(message_)
    { }
    std::string person;
    std::string message;
};

typedef std::map<int, ChatMessage> TChatList;
typedef TChatList::iterator ChatListIterator;

class ChatList {

private:
    int lastput;
    TChatList list;
public:
	ChatList() { lastput = 0; };
	int lastmsg();
    ChatListIterator get(int from);
	ChatListIterator end() { return list.end(); };
    void put(ChatMessage message);
};
